<div class="panel panel-inverse" data-sortable-id="table-basic-4">
    <div class="panel-heading">
        <div class="panel-heading-btn btn-group m-r-20 m-b-5">
            <a href="javascript:;" data-toggle="dropdown" class="btn btn-warning btn-sm dropdown-toggle"><i
                    class="fa fa-cogs"></i></a>
            <ul class="dropdown-menu">
                <li>
                    <a href="javascript:getData('${rc.contextPath}/student/add','${shiroUserHelper.getCurrentShiroUser().parentMenuSource.name}')"><i
                            class="fa fa-plus m-r-5"></i>新增</a></li>
            </ul>
        </div>
        <h4 class="panel-title">学生列表</h4>
    </div>

    <div class="panel-body">
        <div class="table-responsive">
            <table class="table table-striped table-bordered">
                <thead>
                <tr>
                    <th>学生学号</th>
                    <th>姓名</th>
                    <th>所在班级</th>
                    <th>生日（年龄）</th>
                    <th>性别</th>
                    <th>创建时间</th>
                    <th>修改时间</th>
                    <th>最终操作人</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <#if paginationResponse?has_content && paginationResponse.content?exists>
                <#list paginationResponse.content as ct>
                <tr>
                    <td>${ct.stuCode}</td>
                    <td>${ct.stuName}</td>
                    <td>${ct.clazz.clsName}</td>
                    <td class="stuAge">${ct.stuBirth}</td>
                    <td>${ct.stuGender}</td>
                    <td>${ct.createTime}</td>
                    <td>${ct.updateTime}</td>
                    <td>${ct.actor.accountName}</td>
                    <td>
                        <div class="btn-group m-r-5 m-b-5">
                            <a href="javascript:;" data-toggle="dropdown"
                               class="btn btn-default btn-sm dropdown-toggle"><i class="fa fa-bars"></i></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="javascript:getData('${rc.contextPath}/student/edit/${ct.id}','${shiroUserHelper.getCurrentShiroUser().parentMenuSource.name}')"><i
                                            class="fa fa-edit m-r-5"></i>修改</a></li>
                                <li class="divider"></li>
                                <li>
                                    <a href="javascript:getConfirmData('确定删除该学生吗?','${rc.contextPath}/student/delete/${ct.id}','${shiroUserHelper.getCurrentShiroUser().parentMenuSource.name}')"><i
                                            class="fa fa-minus m-r-5"></i>删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                </#list>
            </#if>
            </table>
        </div>
    </div>

    <script type="application/javascript">
        $(document).ready(function () {
            $('.stuAge').hover(function () {
            }, function () {
            });
        });

        function getAge(dateString) {
            var today = new Date();
            var birthDate = new Date(dateString);
            var age = today.getFullYear() - birthDate.getFullYear();
            var m = today.getMonth() - birthDate.getMonth();
            if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
                age--;
            }
            return age;
        }

        function getBirthDate(dateString) {
            Y = date.getFullYear() + '年';
            M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '月';
            D = date.getDate() + '日';

            return Y + M + D;
        }
    </script>
</div>

<!-- 分页组件 -->
<!-- recordBean 分页查询结果Bean
     action 分页请求URL
     formName 分页需要的查询参数的表单名称 -->
<@sp.pagination recordBean=paginationResponse action="${rc.contextPath}/student/list" formName="studentForm" area="studentList"/>